@model ZLMediaServerManagent.Models.ViewDto.PlayStreamProxyDto

@{
ViewData["Title"] = "播放";
}


<link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
<link href="/lib/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet">
<script src="/layuiadmin/layui/layui.all.js"></script>

<div style="height: 100%;width:100%;" id="mainContainer">




</div>
<!-- <div style=" width: 100%;">
	<div class="layui-form layui-card-header layuiadmin-card-header-auto"
		style="border-bottom:1px solid rgba(0, 0, 0, 0.2);background-color: #FFF;">
		<div class="layui-btn-group">
			<button type="button" class="layui-btn  layui-btn-sm">增加</button>
			<button type="button" class="layui-btn  layui-btn-sm">编辑</button>
			<button type="button" class="layui-btn layui-btn-sm">删除</button>
		  </div>
	</div>
</div> -->

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="/assets/js/jquery.js"></script>
<script src="/assets/js/vendor/bootstrap/bootstrap.min.js"></script>





<!-- <script src="/lib/flv.js/flv.min.js"></script> -->
<script src="/js/site.js"></script>
<script src="/EasyWasmPlayer.js"></script>
<script>

	(function ($, h, c) {
		var a = $([]),
			e = $.resize = $.extend($.resize, {}),
			i,
			k = "setTimeout",
			j = "resize",
			d = j + "-special-event",
			b = "delay",
			f = "throttleWindow";
		e[b] = 250;
		e[f] = true;
		$.event.special[j] = {
			setup: function () {
				if (!e[f] && this[k]) {
					return false;
				}
				var l = $(this);
				a = a.add(l);
				$.data(this, d, {
					w: l.width(),
					h: l.height()
				});
				if (a.length === 1) {
					g();
				}
			},
			teardown: function () {
				if (!e[f] && this[k]) {
					return false;
				}
				var l = $(this);
				a = a.not(l);
				l.removeData(d);
				if (!a.length) {
					clearTimeout(i);
				}
			},
			add: function (l) {
				if (!e[f] && this[k]) {
					return false;
				}
				var n;
				function m(s, o, p) {
					var q = $(this),
						r = $.data(this, d);
					r.w = o !== c ? o : q.width();
					r.h = p !== c ? p : q.height();
					n.apply(this, arguments);
				}
				if ($.isFunction(l)) {
					n = l;
					return m;
				} else {
					n = l.handler;
					l.handler = m;
				}
			}
		};
		function g() {
			i = h[k](function () {
				a.each(function () {
					var n = $(this),
						m = n.width(),
						l = n.height(),
						o = $.data(this, d);
					if (m !== o.w || l !== o.h) {
						n.trigger(j, [o.w = m, o.h = l]);
					}
				});
				g();
			},
				e[b]);
		}
	})(jQuery, this);




	$("#mainContainer").resize(function () {
		var height = $('#mainContainer').height();
		$("#videoElement").height(height);
		//当id为main的div大小变化时的处理函数写在这里.....
		//当然了#main只不过是id选择器，你也可以换成任何jquery的选择器......
	});


	function playFlv() {
		// 实例化播放器
		var conf={ cbUserPtr: this, decodeType: "auto", openAudio: false, BigPlay: false, Height: true };
		var Player = new WasmPlayer(null,'mainContainer',callbackFun,conf );
		// 调用播放
		Player.play('@Model.HttpFlvtUrl', 1);
	}


	playFlv();

	function callbackFun(data)
	{
		console.log(data);
	}




</script>